package cn.portx.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.bstek.bdf3.dorado.jpa.annotation.Generator;
import com.bstek.dorado.annotation.PropertyDef;

import cn.portx.annotation.ChineseField;
import cn.portx.policy.ChineseToCodeGeneratorPolicy;
import cn.portx.policy.CreateUserPolicy;
import cn.portx.policy.CreatedDatePolicy;
import cn.portx.policy.IdGeneratorPolicy;

/**
 * Model class of 客户.
 * 
 * @author generated by ERMaster
 * @version $Id$
 */
@Entity
@Table(name = "T_CUSTOMER")
public class Customer extends BaseEntity {

	/** serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** 客户代码. */
	@Column(name = "CODE_", length = 30)
	@ChineseField("name")
	@Generator(policy = ChineseToCodeGeneratorPolicy.class)
	@PropertyDef(label = "客户代码", description = "客户代码:客户代码")
	private String code;

	/** 客户名称. */
	@Column(name = "NAME_", length = 60)
	@PropertyDef(label = "客户名称", description = "客户名称:客户名称")
	private String name;

	/** 公司地址. */
	@Column(name = "COMPANY_ADDRESS_", length = 200)
	@PropertyDef(label = "公司地址", description = "公司地址:公司地址")
	private String companyAddress;

	/** 派单员名称. */
	@Column(name = "DISPATCHER_NAME_", length = 20)
	@PropertyDef(label = "派单员名称", description = "派单员名称:派单员名称")
	private String dispatcherName;

	/** 联系电话. */
	@Column(name = "TEL_", length = 20)
	@PropertyDef(label = "联系电话", description = "联系电话:联系电话")
	private String tel;

	/** 手机号. */
	@Column(name = "PHONE_", length = 11)
	@PropertyDef(label = "手机号", description = "手机号:手机号")
	private String phone;

	/** 传真. */
	@Column(name = "FAX_", length = 30)
	@PropertyDef(label = "传真", description = "传真:传真")
	private String fax;

	/** 邮箱. */
	@Column(name = "MAIL_", length = 60)
	@PropertyDef(label = "邮箱", description = "邮箱:邮箱")
	private String mail;

	/** QQ. */
	@Column(name = "QQ_", length = 15)
	@PropertyDef(label = "QQ", description = "QQ:QQ")
	private String qq;

	/** 备注. */
	@Column(name = "REMARK_", length = 300)
	@PropertyDef(label = "备注", description = "备注:备注")
	private String remark;

	/**
	 * Constructor.
	 */
	public Customer() {
	}

	/**
	 * Set the 客户代码.
	 * 
	 * @param code
	 *            客户代码
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * Get the 客户代码.
	 * 
	 * @return 客户代码
	 */
	public String getCode() {
		return this.code;
	}

	/**
	 * Set the 客户名称.
	 * 
	 * @param name
	 *            客户名称
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get the 客户名称.
	 * 
	 * @return 客户名称
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Set the 公司地址.
	 * 
	 * @param companyAddress
	 *            公司地址
	 */
	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}

	/**
	 * Get the 公司地址.
	 * 
	 * @return 公司地址
	 */
	public String getCompanyAddress() {
		return this.companyAddress;
	}

	/**
	 * Set the 派单员名称.
	 * 
	 * @param dispatcherName
	 *            派单员名称
	 */
	public void setDispatcherName(String dispatcherName) {
		this.dispatcherName = dispatcherName;
	}

	/**
	 * Get the 派单员名称.
	 * 
	 * @return 派单员名称
	 */
	public String getDispatcherName() {
		return this.dispatcherName;
	}

	/**
	 * Set the 联系电话.
	 * 
	 * @param tel
	 *            联系电话
	 */
	public void setTel(String tel) {
		this.tel = tel;
	}

	/**
	 * Get the 联系电话.
	 * 
	 * @return 联系电话
	 */
	public String getTel() {
		return this.tel;
	}

	/**
	 * Set the 手机号.
	 * 
	 * @param phone
	 *            手机号
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 * Get the 手机号.
	 * 
	 * @return 手机号
	 */
	public String getPhone() {
		return this.phone;
	}

	/**
	 * Set the 传真.
	 * 
	 * @param fax
	 *            传真
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 * Get the 传真.
	 * 
	 * @return 传真
	 */
	public String getFax() {
		return this.fax;
	}

	/**
	 * Set the 邮箱.
	 * 
	 * @param mail
	 *            邮箱
	 */
	public void setMail(String mail) {
		this.mail = mail;
	}

	/**
	 * Get the 邮箱.
	 * 
	 * @return 邮箱
	 */
	public String getMail() {
		return this.mail;
	}

	/**
	 * Set the QQ.
	 * 
	 * @param qq
	 *            QQ
	 */
	public void setQq(String qq) {
		this.qq = qq;
	}

	/**
	 * Get the QQ.
	 * 
	 * @return QQ
	 */
	public String getQq() {
		return this.qq;
	}

	/**
	 * Set the 备注.
	 * 
	 * @param remark
	 *            备注
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * Get the 备注.
	 * 
	 * @return 备注
	 */
	public String getRemark() {
		return this.remark;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
		return result;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Customer other = (Customer) obj;
		if (this.getId() == null) {
			if (other.getId() != null) {
				return false;
			}
		} else if (!this.getId().equals(other.getId())) {
			return false;
		}
		return true;
	}

}
